var base = base || {} ;


/**
 * 跨浏览器获取视口大小
 * @returns
 */
base.getInner = function() {
	
	if (typeof window.innerWidth != 'undefined') {
		return {
			width : window.innerWidth,
			height : window.innerHeight
		}
	} else {
		return {
			width : document.documentElement.clientWidth,
			height : document.documentElement.clientHeight
		}
	}
};

/**
 * 如果窗口大于浏览器宽度,返回浏览器宽度
 * @returns
 */
base.getInnerDialogW = function(w) {
	if (typeof window.innerWidth != 'undefined') {
		return {
			width : (w>window.innerWidth?window.innerWidth:w)
		}
	} else {
		return {
			width : (w>document.documentElement.clientWidth?document.documentElement.clientWidth:w)
		}
	}
};
/**
 * 如果窗口大于浏览器高度,返回浏览器高度
 * @returns
 */
base.getInnerDialogH = function(h) {
	if (typeof window.innerWidth != 'undefined') {
		return {
			height : (h>parent.window.innerHeight?parent.window.innerHeight:h)
		}
	} else {
		return {
			height : (h>parent.document.documentElement.clientHeight?parent.document.documentElement.clientHeight:h)
		}
	}
};


/**
 * 跨浏览器获取Style
 * @param element
 * @param attr
 * @returns
 */
base.getStyle = function (element, attr) {
	if (typeof window.getComputedStyle != 'undefined') {//W3C
		return window.getComputedStyle(element, null)[attr];
	} else if (typeof element.currentStyle != 'undeinfed') {//IE
		return element.currentStyle[attr];
	}
};